package conf

import (
	"github.com/spf13/viper"
	"go.uber.org/zap"
)

// BilinAdminSection map toml [bilin-admin]
type BilinAdminSection struct {
	Host  string
	Port  string
}

// ReadBilinAdmin get bilin-admin section from config
func ReadBilinAdmin(v *viper.Viper, slog *zap.SugaredLogger) (bilinAdminConf BilinAdminSection) {
	err := v.Unmarshal(&bilinAdminConf)
	if err != nil {
		slog.Panicf("unable to decode into bilin-admin section, %v", err)
	}
	slog.Debug(bilinAdminConf)
	return
}
